/**
 *
 *@Author:yangwenbo
 *@Date:2021/5/15 0:01
 ***/

// 响应数据格式

class BaseModel {
    constructor( data, msg ) {
        if ( typeof data != 'object') {
            this.msg = data;
            this.data = null;
            msg = ""
        }
        this.data = data;
        this.msg = msg;
    }
}

// 成功模型
class SuccessModel extends BaseModel {
    constructor( data, msg ) {
        super( data, msg );
        this.status = 0;
    }
}

// 失败模型
class ErrorModel extends BaseModel {
    constructor( data, msg ) {
        super( data, msg );
        this.status = -1;
    }
}
module.exports = {
    SuccessModel,
    ErrorModel
}



